****************************************************************************
* File-Name: 		april.do
* Date:		 09/01/2022
* Author: 		Fred Batista
* Purpose: 		Main Analysis March-April comparison
* Data used: 		april.dta
* Data Output:	None	*/
****************************************************************************

**** VARIABLES

* Worried about Covid: P6
* Bolsonaro�s approval: P4
* Bolsosnaro�s administration better or worse than expected: P5
* 2018 vote: P30
* 2022 vote: P32
* S�rgio Moro episode: P14-P18
* main source of information: P35
* religion: P36
* left-right ideology: P28
* income: P37
* sex: AL
* age: AM
* region: AN
* class: AO


***** RECODING VARIABLES

*** DV: worried about COVID

encode P6, gen (worriedcov01)

recode worriedcov01 (1=0) (2=1) (3=2) (4=3) (5=3) (6=4) (7=.)

replace worriedcov01= worriedcov01/4

*** Moderator: Bolsonato support

* evaluation of bolsonaro�s job performance

encode P4, gen(approval)

recode approval (1=4) (2=.) (3=0) (4=2) (5=3) (6=1) (7=5) 

gen approval01 = approval/5

* bolsonaro�s admin better or worse than expected (Dk combined as middle)

encode P5, gen(bolsoexp)

recode bolsoexp (1=2) (2 3=1) (4=0)

gen bolsoexp01 = bolsoexp/2

* 2018 vote (null and absent as neutral category)

encode P30, gen(vote18)

gen haddadvoter = vote18

recode haddadvoter (2=1) (else=0)

gen bolsovoter = vote18

recode bolsovoter (3=1) (else=0)

* 2022 vote (DK as neutral category)

encode P32, gen(vote22)

gen haddadfuture = vote22

recode haddadfuture (1=1) (else=0)

gen bolsofuture = vote22

recode bolsofuture (2=1) (else=0)

* general feelingsabout bolsonaro (similar to March)

polychoric approval01 bolsoexp01 bolsovoter bolsofuture

alpha approval01 bolsoexp01 bolsovoter bolsofuture, std

gen bolsoeval = (approval01 + bolsoexp01 + bolsovoter + bolsofuture)/4

*** Control variable: S�rgio Moro episode 

encode P14, gen(bolsovmoro1)

recode bolsovmoro1 (4=.5) (5=0) (6=1)

encode P15, gen(bolsovmoro2)

recode bolsovmoro2 (3=0.5) (4=1) (5=0)

encode P16, gen(bolsovmoro3)

recode bolsovmoro3 (4=0) (5=1) (2=.5)

encode P17, gen(bolsovmoro4)

recode bolsovmoro4 (1=.5) (2=1) (3=0)

encode P18, gen(bolsovmoro5)

recode bolsovmoro5 (1=0) (2=1) (3 4=.5)

polychoric bolsovmoro1 bolsovmoro2 bolsovmoro3 bolsovmoro4 bolsovmoro5

alpha bolsovmoro1 bolsovmoro2 bolsovmoro3 bolsovmoro4 bolsovmoro5

gen bolsovmoro = (bolsovmoro1 + bolsovmoro2 + bolsovmoro3 + bolsovmoro4 + bolsovmoro5)/5

*** Other controls 

* most trustworthy information source

encode P35, gen(infosource)

gen sourcetv = infosource

recode sourcetv (1=1) (else=0)

gen sourcenet = infosource

recode sourcenet (5 6=1) (else=0)

* religion

encode P36, gen(religion)

gen catholic = religion

recode catholic (1=1)(else=0)

gen protestant = religion

recode protestant (2 6=1) (else=0)

* ideology (higher is right)

encode P28, gen(ideo)

recode ideo (1=0) (2=1) (3=10) (4=2) (5=3) (6=4) (7=5) (8=6) (9=7) (10=8) (11=9)

gen ideo01 = ideo/10

* income

encode P37, gen(income)

recode income (9=.)

gen income01 = (income -1)/7

* sex (male=1)

encode AL, gen(male)

replace male = male - 1

* age

encode AM, gen(age)

gen age01 = (age-1)/61

* region

encode AN, gen(region)

* social class

encode AO, gen(class)

recode class (6=.)

replace class = 5 - class

gen class01= class/4



****** DESCRIPTIVE STATISTICS

* descriptives for full sample (Table ??)

summarize worriedcov01 bolsoeval age01 sourcetv sourcenet ideo01 catholic protestant income male region

* dimensionality of support for bolsonaro (Table ??)

polychoric approval01 bolsoexp01 bolsovoter bolsofuture

alpha approval01 bolsoexp01 bolsovoter bolsofuture

factor approval01 bolsoexp01 bolsovoter bolsofuture, ml factor(1)


******************** COMPARISON TO MARCH

* keeping only main variables

keep worriedcov01 bolsoeval bolsovmoro age01 sourcetv sourcenet ideo01 catholic protestant income01 male region

* generating survey id

gen april=1

* appending March data (marchred)

append using marchred

* ATE (Figure 3, Table A7)

oprobit worriedcov01 i.april c.bolsoeval age01 sourcetv sourcenet ideo01 catholic protestant income01 male i.region

margins, predict(outcome(1)) at(april=(0(1)1))

marginsplot, plot1(mcolor(black) connect(none)) ci1(lcolor(black) msize(vtiny)) ytitle("", height(7)) xtitle("Sample", size(medlarge) margin(medsmall)) xlabel(-.5 " " 0 "March" 1 "April" 1.5 " ", noticks labsize(medium)) ylabel(.5 ".50" .6 ".60" .7 ".70" .8 ".80" .9 ".90" 1 "1.00" ,nogrid) title("", color(black) size(vlarge)) yscale(noextend) xscale(noextend)  plotregion(style(none) margin(medlarge)) graphregion(color(white) margin(medlarge)) ysize(8) xsize(8) saving(con_ob1)

* HTE (Figure 3, Table A7)

oprobit worriedcov01 i.april##c.bolsoeval age01 sourcetv sourcenet ideo01 catholic protestant income01 male i.region

margins, predict(outcome(1)) at(bolsoeval=(0(.1)1) april=(0(1)1))

marginsplot, plot1(mcolor(black) connect(direct) lcolor(black)) ci1(lcolor(black) msize(vtiny)) plot2(mcolor(gs12) connect(direct) lcolor(gs12)) ci2(lcolor(gs12) msize(vtiny)) plotdimensions(,label("March" "April")) ytitle("")  xtitle(Bolsonaro Support, size(medlarge) margin(medsmall)) xlabel(0 "Lowest" .1 " " .2" " .3 " " .4 " " .5 " " .6 " " .7 " " .8 " " .9 " " 1 "Highest", labsize(medium)) ylabel(0 "0" .2 ".2" .4 ".4" .6 ".6" .8 ".8" 1 "1" , nogrid) title("", color(black) size(large)) legend(col(1) pos(6) ring(0) region(lstyle(none))) yscale(noextend) xscale(noextend) plotregion(style(none) margin(medlarge)) graphregion(color(white) margin(medlarge)) ysize(8) xsize(8) saving(con_ob2)

* combining ATE and HTE graphs (Figure 3)

graph combine con_ob1.gph con_ob2.gph, title(, size(vlarge)) plotregion(style(none)) graphregion(color(white)) rows(1) ysize(8) xsize(14) iscale(1)



*** ROBUSTNESS CHECKS

* controlling for ideology (Table A12)

oprobit worriedcov01 i.april##c.bolsoeval i.april##c.ideo01 age01 sourcetv sourcenet catholic protestant income01 male i.region

* controlling for income (Table A13)

oprobit worriedcov01 i.april##c.bolsoeval i.april##c.income01 age01 sourcetv sourcenet ideo01 catholic protestant income01 male i.region

* controlling ATE for the S�rgio Moro scandal (Table A14)

oprobit worriedcov01 bolsoeval bolsovmoro age01 sourcetv sourcenet ideo01 catholic protestant income01 male i.region if april==1



******* END OF CODE
